//
//  SnakeBody.h
//  SnakeGame
//
//  Created by Hansuck Shim on 2014. 3. 23..
//  Copyright (c) 2014년 Hansuck Shim. All rights reserved.
//

#ifndef SnakeGame_SnakeBody_h
#define SnakeGame_SnakeBody_h

struct SSnakeBodyNode
{
    int nX;
    int nY;
    struct SSnakeBodyNode  *pNext;
};

int g_nHeadDirX;
int g_nHeadDirY;
int g_nKeyDirX;
int g_nKeyDirY;
struct SSnakeBodyNode *g_pSnake;

#define SNAKE_IS_NOT_THERE  0
#define SNAKE_IS_THERE      1

#define SNAKE_UNMOVABLE     0
#define SNAKE_MOVABLE_EMPTY 1
#define SNAKE_MOVABLE_FOOD  2

struct SSnakeBodyNode* AllocSnakeBody(void);
void AppendSnakeBody( struct SSnakeBodyNode *pNode );
void ResetSnakeBody( unsigned int uCnt );
void MoveSnake(void);
int IsSnakeThere( unsigned int uX, unsigned int uY );
int CheckSnakeMovable(void);
int GetSnakeLength(void);

#endif
